CRITICAL: 2
};
+const rewriteRules = {
+ 'XChat': [
+ { pattern: /^XChat: Private message from: (\S*) \(.*\)$/,
+ replacement: '<$1>' },
+ { pattern: /^XChat: New public message from: (\S*) \((.*)\)$/,
+ replacement: '$2 <$1>' },
+ { pattern: /^XChat: Highlighted message from: (\S*) \((.*)\)$/,
+ replacement: '$2 <$1>' }
+ ]
+};
function NotificationDaemon() {
this._init();
}
summary = GLib.markup_escape_text(summary, -1);
+ let rewrites = rewriteRules[appName];
+ if (rewrites) {
+ for (let i = 0; i < rewrites.length; i++) {
+ let rule = rewrites[i];
+ if (summary.search(rule.pattern) != -1)
+ summary = summary.replace(rule.pattern, rule.replacement);
+ }
+ }
+
let notification = new MessageTray.Notification(source, summary, body, true);
if (actions.length) {
for (let i = 0; i < actions.length - 1; i += 2)